﻿using System.IO;
using System.Reflection;

namespace Bookvar.Common
{
    public static class AssemblyUtility
    {
		public static byte[] LoadImageFromResources( Assembly assembly, string imageName )
        {
        	byte[] image = null;
            using ( Stream imageStream = assembly.GetManifestResourceStream( imageName ) )
            {
            	if ( imageStream != null )
            	{
            		int imageLength = (int) imageStream.Length;
            		image = new byte[imageLength];
            		imageStream.Read( image, 0, imageLength );

            		return image;
            	}
            }
        	return image;
        }
    }
}